package com.boxin.ims.modules.wechat.service;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.boxin.ims.modules.wechat.dao.WechatMessageDao;
import com.boxin.ims.modules.wechat.entity.WechatMessage;
import com.boxin.ims.modules.wechat.entity.WechatMessageNear;
import com.thinkgem.jeesite.common.service.BaseService;


/**
 * 微信即时信息
 * @author xiaoqian
 *
*	2014上午11:24:59
 */
@Component
@Transactional(readOnly = true)
public class WechatMessageService extends BaseService {
	
	@SuppressWarnings("unused")
	private static Logger logger = LoggerFactory.getLogger(BaseService.class);
	
	@Autowired
	private WechatMessageDao wechatMessageDao;
	
	@Autowired
	private WechatMessageNearService wechatMessageNearService;
	
	
	
	@Transactional(readOnly = false)
	public void save(WechatMessage wechatMessage) {
		wechatMessageNearService.save(WechatMessageNear.parse(wechatMessage));
		wechatMessageDao.save(wechatMessage);
	}
}
